/**********************************************************
Leo Engine - v0.9

file: CompositeMesh.h
creation date: 15/05/2009
**********************************************************/

//---------------------------------------------------------
#ifndef LEO_COMPOSITEMESH_H
#define LEO_COMPOSITEMESH_H
//---------------------------------------------------------
#include "Entity3D.h"
#include "os/Graphics/Texture.h"
#include "XFile.h"
#include <string>
using namespace std;
//---------------------------------------------------------
namespace leo
{
//---------------------------------------------------------
class Graphics;
struct TextureVertex;
//---------------------------------------------------------
class LEO_API CompositeMesh : public Entity3D
{
protected:	
	 
	VertexBuffer<TextureVertex, TEXTURE_VERTEX>::Ptr vertexBuffer;
	leo::Texture::Ptr textura;

	IndexBuffer::Ptr indexBuffer;
	
	
public:
	CompositeMesh(int _posX, int _posY, int _posZ, std::string _fileNamel, leo::Texture::Ptr _tex);
	~CompositeMesh(void);

	void OnDraw(leo::Graphics *_graph) const;

	void LoadFromXFile(const std::string& _filename, leo::Graphics& _graph);

	void SetVertexBuffer(VertexBuffer<TextureVertex, TEXTURE_VERTEX>::Ptr _vertexBuffer);
	void SetIndexBuffer(IndexBuffer::Ptr _indexBuffer);
};

//---------------------------------------------------------
} // end namespace
//---------------------------------------------------------
#endif // LEO_MESH_H
//---------------------------------------------------------
